/*
Farmer Duel beneath an Active Volcano
(c) Rachel J. Morris, 2011
June - July 2011 project
http://www.moosader.com/

Farmer Duel - GNU GPL v3
Sader - MIT
*/

#ifndef _StateGame
#define _StateGame

#include <iostream>

#include "sader/State.h"
#include "sader/Texture.h"
#include "sader/ManagerMap.h"
#include "sader/ManagerTexture.h"
#include "sader/Geometry.h"

#include "Character.h"
#include "Item.h"
#include "Hud.h"
#include "Input.h"
#include "EnumAction.h"

class StateGame : public sader::State
{
    private:
        bool debug;
        EnumState m_code;
        Input m_input;
        sader::ManagerTexture m_textureMgr;
        sader::ManagerMap m_mapMgr;
        void HandleInput();
        int m_playerWins;
        sader::BaseCamera m_camera;
        // temp
        Character player1;
        Character player2;
        Item pong;
        Hud player1Score;
        Hud player2Score;
        Hud labelWins;
        Hud labelPlayer;
        Hud labelNumber;
        sader::BaseCharacter player1Boundary, player2Boundary; // boundary region for map
        // Functionality
        void LoadAssets();
        bool GameActive() { return (!pause && m_playerWins <= 0); }
        void Render();
    public:
        StateGame();
        // Main game loop
        int MainLoop();
        void Init();
        // Accessors
        EnumState Code() { return m_code; }
};

#endif
